package com.example.demo.service.impl;

import com.example.demo.entity.CourseCategory;
import com.example.demo.mapper.CourseCategoryMapper;
import com.example.demo.service.CourseCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseCategoryServiceImpl implements CourseCategoryService {

    @Autowired
    private CourseCategoryMapper courseCategoryMapper;

    @Override
    public int insertCourseCategory(CourseCategory courseCategory) {
        return courseCategoryMapper.insertCourseCategory(courseCategory);
    }

    @Override
    public int deleteCourseCategoryById(int id) {
        return courseCategoryMapper.deleteCourseCategoryById(id);
    }

    @Override
    public int updateCourseCategory(CourseCategory courseCategory) {
        return courseCategoryMapper.updateCourseCategory(courseCategory);
    }

    @Override
    public CourseCategory selectCourseCategoryById(int id) {
        return courseCategoryMapper.selectCourseCategoryById(id);
    }

    @Override
    public List<CourseCategory> selectAllCourseCategories() {
        return courseCategoryMapper.selectAllCourseCategories();
    }
}